﻿@{
    Layout = "_LayoutAdmin";
}

@model ContentSettingsViewModel

<partial name="_SettingsHeader" />

<form id="form-settings" asp-controller="Settings" asp-action="ContentSettings"
      data-ajax-begin="onUpdateSettingsBegin"
      data-ajax-complete="onUpdateSettingsComplete"
      data-ajax-failure="onUpdateSettingsFailed"
      data-ajax-success="onUpdateSettingsSuccess"
      data-ajax="true"
      data-ajax-method="POST">
    <div asp-validation-summary="All" class="text-danger"></div>

    <div class="row">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">Comments</div>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item">
                        <label asp-for="EnableComments" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.EnableComments ? "checked=\"checked\"" : string.Empty) id="EnableComments" name="EnableComments" type="checkbox" value="true">
                            <label for="EnableComments" class="label-success"></label>
                            <input name="EnableComments" type="hidden" value="false">
                        </div>
                    </li>
                    <li class="list-group-item">
                        <label asp-for="RequireCommentReview" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.RequireCommentReview ? "checked=\"checked\"" : string.Empty) id="RequireCommentReview" name="RequireCommentReview" type="checkbox" value="true">
                            <label for="RequireCommentReview" class="label-success"></label>
                            <input name="RequireCommentReview" type="hidden" value="false">
                        </div>
                    </li>
                    <li class="list-group-item">
                        <label asp-for="EnableGravatar" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.EnableGravatar ? "checked=\"checked\"" : string.Empty) id="EnableGravatar" name="EnableGravatar" type="checkbox" value="true">
                            <label for="EnableGravatar" class="label-success"></label>
                            <input name="EnableGravatar" type="hidden" value="false">
                        </div>
                    </li>
                    <li class="list-group-item">
                        <label asp-for="EnableWordFilter" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.EnableWordFilter ? "checked=\"checked\"" : string.Empty) id="EnableWordFilter" name="EnableWordFilter" type="checkbox" value="true">
                            <label for="EnableWordFilter" class="label-success"></label>
                            <input name="EnableWordFilter" type="hidden" value="false">
                        </div>
                    </li>
                </ul>
                <div class="card-body">
                    <div class="form-group">
                        <label asp-for="DisharmonyWords" class="control-label"></label>
                        <textarea asp-for="DisharmonyWords" class="form-control h-300px"></textarea>
                        <span asp-validation-for="DisharmonyWords" class="text-danger"></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card mb-3">
                <div class="card-header">Blog posts</div>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item">
                        <label asp-for="UseFriendlyNotFoundImage" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.UseFriendlyNotFoundImage ? "checked=\"checked\"" : string.Empty) id="UseFriendlyNotFoundImage" name="UseFriendlyNotFoundImage" type="checkbox" value="true">
                            <label for="UseFriendlyNotFoundImage" class="label-success"></label>
                            <input name="UseFriendlyNotFoundImage" type="hidden" value="false">
                        </div>
                    </li>
                    <li class="list-group-item">
                        <label asp-for="EnableImageLazyLoad" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.EnableImageLazyLoad ? "checked=\"checked\"" : string.Empty) id="EnableImageLazyLoad" name="EnableImageLazyLoad" type="checkbox" value="true">
                            <label for="EnableImageLazyLoad" class="label-success"></label>
                            <input name="EnableImageLazyLoad" type="hidden" value="false">
                        </div>
                    </li>
                </ul>
                <div class="card-body">
                    <div class="form-group">
                        <label asp-for="PostListPageSize" class="control-label"></label>
                        <input asp-for="PostListPageSize" class="form-control" />
                        <span asp-validation-for="PostListPageSize" class="text-danger"></span>
                    </div>
                    <div class="form-group">
                        <label asp-for="HotTagAmount" class="control-label"></label>
                        <input asp-for="HotTagAmount" class="form-control" />
                        <span asp-validation-for="HotTagAmount" class="text-danger"></span>
                    </div>
                </div>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item">
                        <label asp-for="ShowPostFooter" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.ShowPostFooter ? "checked=\"checked\"" : "") id="ShowPostFooter" name="ShowPostFooter" type="checkbox" value="true">
                            <label for="ShowPostFooter" class="label-success"></label>
                            <input name="ShowPostFooter" type="hidden" value="false">
                        </div>
                    </li>
                </ul>
                <div class="card-body">
                    <div class="form-group">
                        <label asp-for="PostFooterHtmlPitch" class="control-label"></label>
                        <textarea asp-for="PostFooterHtmlPitch" class="form-control" style="font-size: 12px; font-family: 'Consolas'" spellcheck="false"></textarea>
                        <span asp-validation-for="PostFooterHtmlPitch" class="text-danger"></span>
                    </div>
                </div>
            </div>
            <div class="card">
                <div class="card-header">Call-out</div>
                <ul class="list-group list-group-flush">
                    <li class="list-group-item">
                        <label asp-for="ShowCalloutSection" class="control-label"></label>
                        <div class="material-switch float-right">
                            <input @(Model.ShowCalloutSection ? "checked=\"checked\"" : "") id="ShowCalloutSection" name="ShowCalloutSection" type="checkbox" value="true">
                            <label for="ShowCalloutSection" class="label-success"></label>
                            <input name="ShowCalloutSection" type="hidden" value="false">
                        </div>
                    </li>
                </ul>
                <div class="card-body">
                    <div class="form-group">
                        <label asp-for="CalloutSectionHtmlPitch" class="control-label"></label>
                        <textarea asp-for="CalloutSectionHtmlPitch" class="form-control" style="font-size: 12px; font-family: 'Consolas'" spellcheck="false"></textarea>
                        <span asp-validation-for="CalloutSectionHtmlPitch" class="text-danger"></span>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <hr />
    <div class="form-group">
        <input id="btn-save-settings" type="submit" value="Save" class="btn btn-success" />
    </div>
</form>